import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView.vue'),
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },
    // 爱吃兔溯源管理系统路由
    {
      path: '/company-manage',
      name: 'companyManage',
      component: () => import('../views/CompanyManageView.vue'),
      meta: {
        title: '企业管理'
      }
    },
    {
      path: '/product-detail/:id?',
      name: 'productDetail',
      component: () => import('../views/ProductDetailView.vue'),
      meta: {
        title: '产品详情'
      }
    },
    {
      path: '/traceability',
      name: 'traceability',
      component: () => import('../views/TraceabilityView.vue'),
      meta: {
        title: '溯源管理'
      }
    },
     {
      path: '/BasicInformation',
      name: 'BasicInformation',
      component: () => import('../views/BasicInformationView.vue'),
    },
  ],
})

export default router
